
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.ApusicPackage;
import Apusic.HttpWebCfg;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Http Web Cfg</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.HttpWebCfgImpl#getMaxWaitingClients <em>Max Waiting Clients</em>}</li>
 *   <li>{@link Apusic.impl.HttpWebCfgImpl#getWaitingClientTimeout <em>Waiting Client Timeout</em>}</li>
 *   <li>{@link Apusic.impl.HttpWebCfgImpl#getFileCacheSize <em>File Cache Size</em>}</li>
 *   <li>{@link Apusic.impl.HttpWebCfgImpl#getServletReloadCheckInterval <em>Servlet Reload Check Interval</em>}</li>
 *   <li>{@link Apusic.impl.HttpWebCfgImpl#getLogFileName <em>Log File Name</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HttpWebCfgImpl extends WrappingEObjectImpl implements HttpWebCfg
{
  /**
   * The default value of the '{@link #getMaxWaitingClients() <em>Max Waiting Clients</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMaxWaitingClients()
   * @generated
   * @ordered
   */
  protected static final int MAX_WAITING_CLIENTS_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getMaxWaitingClients() <em>Max Waiting Clients</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMaxWaitingClients()
   * @generated
   * @ordered
   */
  protected int maxWaitingClients = MAX_WAITING_CLIENTS_EDEFAULT;

  /**
   * The default value of the '{@link #getWaitingClientTimeout() <em>Waiting Client Timeout</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getWaitingClientTimeout()
   * @generated
   * @ordered
   */
  protected static final int WAITING_CLIENT_TIMEOUT_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getWaitingClientTimeout() <em>Waiting Client Timeout</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getWaitingClientTimeout()
   * @generated
   * @ordered
   */
  protected int waitingClientTimeout = WAITING_CLIENT_TIMEOUT_EDEFAULT;

  /**
   * The default value of the '{@link #getFileCacheSize() <em>File Cache Size</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFileCacheSize()
   * @generated
   * @ordered
   */
  protected static final int FILE_CACHE_SIZE_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getFileCacheSize() <em>File Cache Size</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFileCacheSize()
   * @generated
   * @ordered
   */
  protected int fileCacheSize = FILE_CACHE_SIZE_EDEFAULT;

  /**
   * The default value of the '{@link #getServletReloadCheckInterval() <em>Servlet Reload Check Interval</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getServletReloadCheckInterval()
   * @generated
   * @ordered
   */
  protected static final int SERVLET_RELOAD_CHECK_INTERVAL_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getServletReloadCheckInterval() <em>Servlet Reload Check Interval</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getServletReloadCheckInterval()
   * @generated
   * @ordered
   */
  protected int servletReloadCheckInterval = SERVLET_RELOAD_CHECK_INTERVAL_EDEFAULT;

  /**
   * The default value of the '{@link #getLogFileName() <em>Log File Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLogFileName()
   * @generated
   * @ordered
   */
  protected static final String LOG_FILE_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getLogFileName() <em>Log File Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLogFileName()
   * @generated
   * @ordered
   */
  protected String logFileName = LOG_FILE_NAME_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected HttpWebCfgImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.HTTP_WEB_CFG;
  }

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public boolean isForCore(Object arg0){
   	boolean result=true;
   	if(core==null) return false;
    try{
    result=true;
    }
    catch(Exception e){
      result=false;
    }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    HttpWebConfig core=(HttpWebConfig)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
  
  
  
  
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getMaxWaitingClients()
  {
        Object result=null;
        HttpWebConfig core=(HttpWebConfig)getCore();
        if(core==null) return maxWaitingClients;	
        try
{
maxWaitingClients=core.getMaxWaitingClients();
}
catch(Exception e)
{
  maxWaitingClients = -1;
}
    return maxWaitingClients; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMaxWaitingClients(int newMaxWaitingClients)
  {
    int oldMaxWaitingClients = maxWaitingClients;
    maxWaitingClients = newMaxWaitingClients;
        	
      HttpWebConfig core=(HttpWebConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_WEB_CFG__MAX_WAITING_CLIENTS, oldMaxWaitingClients, maxWaitingClients));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getWaitingClientTimeout()
  {
        Object result=null;
        HttpWebConfig core=(HttpWebConfig)getCore();
        if(core==null) return waitingClientTimeout;	
        try
{
waitingClientTimeout=core.getWaitingClientTimeout();
}
catch(Exception e)
{
  waitingClientTimeout = -1;
}
    return waitingClientTimeout; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setWaitingClientTimeout(int newWaitingClientTimeout)
  {
    int oldWaitingClientTimeout = waitingClientTimeout;
    waitingClientTimeout = newWaitingClientTimeout;
        	
      HttpWebConfig core=(HttpWebConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_WEB_CFG__WAITING_CLIENT_TIMEOUT, oldWaitingClientTimeout, waitingClientTimeout));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getFileCacheSize()
  {
        Object result=null;
        HttpWebConfig core=(HttpWebConfig)getCore();
        if(core==null) return fileCacheSize;	
        try
{
fileCacheSize=core.getFileCacheSize();
}
catch(Exception e)
{
  fileCacheSize = -1;
}
    return fileCacheSize; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFileCacheSize(int newFileCacheSize)
  {
    int oldFileCacheSize = fileCacheSize;
    fileCacheSize = newFileCacheSize;
        	
      HttpWebConfig core=(HttpWebConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_WEB_CFG__FILE_CACHE_SIZE, oldFileCacheSize, fileCacheSize));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getServletReloadCheckInterval()
  {
        Object result=null;
        HttpWebConfig core=(HttpWebConfig)getCore();
        if(core==null) return servletReloadCheckInterval;	
        try
{
servletReloadCheckInterval=core.getServletReloadCheckInterval();
}
catch(Exception e)
{
  servletReloadCheckInterval = -1;
}
    return servletReloadCheckInterval; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setServletReloadCheckInterval(int newServletReloadCheckInterval)
  {
    int oldServletReloadCheckInterval = servletReloadCheckInterval;
    servletReloadCheckInterval = newServletReloadCheckInterval;
        	
      HttpWebConfig core=(HttpWebConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_WEB_CFG__SERVLET_RELOAD_CHECK_INTERVAL, oldServletReloadCheckInterval, servletReloadCheckInterval));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getLogFileName()
  {
        Object result=null;
        HttpWebConfig core=(HttpWebConfig)getCore();
        if(core==null) return logFileName;	
        try
{
logFileName=core.getLogFileName();
}
catch(Exception e)
{
  logFileName = null;
}
    return logFileName; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLogFileName(String newLogFileName)
  {
    String oldLogFileName = logFileName;
    logFileName = newLogFileName;
        	
      HttpWebConfig core=(HttpWebConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_WEB_CFG__LOG_FILE_NAME, oldLogFileName, logFileName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_WEB_CFG__MAX_WAITING_CLIENTS:
        return new Integer(getMaxWaitingClients());
      case ApusicPackage.HTTP_WEB_CFG__WAITING_CLIENT_TIMEOUT:
        return new Integer(getWaitingClientTimeout());
      case ApusicPackage.HTTP_WEB_CFG__FILE_CACHE_SIZE:
        return new Integer(getFileCacheSize());
      case ApusicPackage.HTTP_WEB_CFG__SERVLET_RELOAD_CHECK_INTERVAL:
        return new Integer(getServletReloadCheckInterval());
      case ApusicPackage.HTTP_WEB_CFG__LOG_FILE_NAME:
        return getLogFileName();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_WEB_CFG__MAX_WAITING_CLIENTS:
        setMaxWaitingClients(((Integer)newValue).intValue());
        return;
      case ApusicPackage.HTTP_WEB_CFG__WAITING_CLIENT_TIMEOUT:
        setWaitingClientTimeout(((Integer)newValue).intValue());
        return;
      case ApusicPackage.HTTP_WEB_CFG__FILE_CACHE_SIZE:
        setFileCacheSize(((Integer)newValue).intValue());
        return;
      case ApusicPackage.HTTP_WEB_CFG__SERVLET_RELOAD_CHECK_INTERVAL:
        setServletReloadCheckInterval(((Integer)newValue).intValue());
        return;
      case ApusicPackage.HTTP_WEB_CFG__LOG_FILE_NAME:
        setLogFileName((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_WEB_CFG__MAX_WAITING_CLIENTS:
        setMaxWaitingClients(MAX_WAITING_CLIENTS_EDEFAULT);
        return;
      case ApusicPackage.HTTP_WEB_CFG__WAITING_CLIENT_TIMEOUT:
        setWaitingClientTimeout(WAITING_CLIENT_TIMEOUT_EDEFAULT);
        return;
      case ApusicPackage.HTTP_WEB_CFG__FILE_CACHE_SIZE:
        setFileCacheSize(FILE_CACHE_SIZE_EDEFAULT);
        return;
      case ApusicPackage.HTTP_WEB_CFG__SERVLET_RELOAD_CHECK_INTERVAL:
        setServletReloadCheckInterval(SERVLET_RELOAD_CHECK_INTERVAL_EDEFAULT);
        return;
      case ApusicPackage.HTTP_WEB_CFG__LOG_FILE_NAME:
        setLogFileName(LOG_FILE_NAME_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_WEB_CFG__MAX_WAITING_CLIENTS:
        return maxWaitingClients != MAX_WAITING_CLIENTS_EDEFAULT;
      case ApusicPackage.HTTP_WEB_CFG__WAITING_CLIENT_TIMEOUT:
        return waitingClientTimeout != WAITING_CLIENT_TIMEOUT_EDEFAULT;
      case ApusicPackage.HTTP_WEB_CFG__FILE_CACHE_SIZE:
        return fileCacheSize != FILE_CACHE_SIZE_EDEFAULT;
      case ApusicPackage.HTTP_WEB_CFG__SERVLET_RELOAD_CHECK_INTERVAL:
        return servletReloadCheckInterval != SERVLET_RELOAD_CHECK_INTERVAL_EDEFAULT;
      case ApusicPackage.HTTP_WEB_CFG__LOG_FILE_NAME:
        return LOG_FILE_NAME_EDEFAULT == null ? logFileName != null : !LOG_FILE_NAME_EDEFAULT.equals(logFileName);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (maxWaitingClients: ");
    result.append(maxWaitingClients);
    result.append(", waitingClientTimeout: ");
    result.append(waitingClientTimeout);
    result.append(", fileCacheSize: ");
    result.append(fileCacheSize);
    result.append(", servletReloadCheckInterval: ");
    result.append(servletReloadCheckInterval);
    result.append(", logFileName: ");
    result.append(logFileName);
    result.append(')');
    return result.toString();
  }

} //HttpWebCfgImpl
